package com.p7.framework.permission.shiro.utils;

import com.p7.framework.permission.shiro.session.ExpireBusinessFacade;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author Yangzhen
 * @Description
 * @date 2019-10-23 14:45
 **/
@Component
public class ExpireBusinessUtils implements InitializingBean {

    public static ExpireBusinessFacade expireBusinessFacade;

    @Resource
    private ApplicationContext applicationContext;

    @Override
    public void afterPropertiesSet() throws Exception {

        try {
            expireBusinessFacade = applicationContext.getBean(ExpireBusinessFacade.class);
        } catch (NoSuchBeanDefinitionException e) {
            expireBusinessFacade = null;
        }
    }
}
